package com.ship.system.api.factory;

import com.ship.common.core.base.Constant;
import com.ship.common.core.domain.R;
import com.ship.system.api.RemoteCommonService;
import com.ship.system.api.RemoteFileService;
import com.ship.system.api.domain.SysFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 合同模块通用服务降级处理
 * 
 * @author zhangyh
 */
@Component
public class RemoteCommonFallbackFactory implements FallbackFactory<RemoteCommonService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteCommonFallbackFactory.class);

    @Override
    public RemoteCommonService create(Throwable throwable)
    {
        log.error("合同服务调用失败:{}", throwable.getMessage());
        return new RemoteCommonService()
        {
            @Override
            public void contractExpireMessageSend() {

            }

            @Override
            public List<Constant> listByType(String enumName) {
                return null;
            }

            @Override
            public void checkConShipState() {

            }
        };
    }
}
